import request from '../utils/request';
//获取商品信息
export const fetchgoodsData = query => {
    return request({
        url: '/WORKSPACE/apis/goods',
        method: 'get',
        params: query,
    });
};
// 获取订单信息
export const fetchorderData = query => {
    return request({
        url: '/WORKSPACE/apis/orders',
        method: 'get',
        params: query,
    });
};
// 获取订单细则信息
export const fetchorderdetailData = query => {
    return request({
        url: '/WORKSPACE/apis/orderdetails',
        method: 'get',
        params: query,
    });
};
// 获取发票信息
export const fetchbillData = query => {
    return request({
        url: '/WORKSPACE/apis/bill',
        method: 'get',
        params: query,
    });
};
//获取顾客信息
export const fetchconsumerData = query => {
    return request({
        url: '/WORKSPACE/apis/consumer',
        method: 'get',
        params: query,
    });
};

// 购买商品，并生成订单
export const fetchBuyGoods = query =>{
     return request({
         url: '/WORKSPACE/apis/orders',
         method: 'post',
         data: query
     });
};
// 申请发票
export const reqbill = query => {
    return request({
        url: '/WORKSPACE/apis/bill',
        method: 'post',
        data: query,
    });
};
//添加顾客信息
export const addconsumer = query => {
    return request({
        url: '/WORKSPACE/apis/consumer',
        method: 'post',
        data: query,
    });
};
//添加细则信息
export const adddetails = query => {
    return request({
        url: '/WORKSPACE/apis/orderdetails',
        method: 'post',
        data: query,
    });
};
export const addgoods = query => {
    return request({
        url: '/WORKSPACE/apis/goods',
        method: 'post',
        data: query,
    });
};

//删除发票信息
export const billdelete = query => {
    return request({
        url: '/WORKSPACE/apis/bill',
        method: 'delete',
        data: query,
    });
};
//删除顾客信息
export const consumerdelete = query => {
    return request({
        url: '/WORKSPACE/apis/consumer',
        method: 'delete',
        data: query,
    });
};
//删除商品信息
export const goodsdelete = query => {
    return request({
        url: '/WORKSPACE/apis/goods',
        method: 'delete',
        data: query,
    });
};

